package com.ym521.simple

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.ym521.skeleton.Skeleton
import com.ym521.skeleton.core.BlockViewSkeletonScreen

class BlockViewActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_block_view)
        val view = findViewById<View>(R.id.rootView)
        val sk: BlockViewSkeletonScreen = Skeleton.bind(view, R.layout.skeleton_block_view)
            .load(R.id.vView1, R.id.vView2, R.id.vView3, R.id.vView4)
            .duration(1500)
            .angle(30)
            .color(R.color.white)
            .show()

        Thread {
            Thread.sleep(10 * 1000)
            runOnUiThread {
                sk.dismiss()
            }
        }.start()
    }
}